import { configureStore } from "@reduxjs/toolkit";
import { useSelector,TypedUseSelectorHook,useDispatch,shallowEqual } from "react-redux";

import counterReducer from './modules/counter'
import musicReducer from './modules/music'
const store = configureStore({
  reducer: {
    music: musicReducer,
  },
});

type GetStateFnType=typeof store.getState
export type IRootState=ReturnType<GetStateFnType>
type DispatchType=typeof store.dispatch

export const useAppSelector:TypedUseSelectorHook<IRootState>=useSelector
export const useAppDispatch:()=>DispatchType=useDispatch
export const appShallowEqual=shallowEqual

export default store